package bean;

import dao.IDIF;

/**
 * A base class for Post for manipulation of the data
 * @author Anne Lorayne, Laura Dutra
 *
 */
public class PostBean implements IDIF {
 
	
	private String Id;
	 
	private String title;
	private String content;
	private String date;
	
	private String owner;

	private String lastMediaId;

	private String lastCommentId;
	 
	/**
	 * Constructor of the class
	 * @param ID
	 * @param content
	 */
	public PostBean(String ID, String title, String content, String date, String owner){
		this.Id = ID;
		this.title = title;
		this.content = content;
		this.date = date;
		this.owner = owner;
		lastMediaId = "0";
		lastCommentId = "0";
		
	}
	
	public PostBean(){};
	
	
	// ------Getters and Setters------
	
	public String getId() {
		return Id;
	}
	

	public void setId(String iD) {
		Id = iD;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	/**
	 * @return the title
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * @param title the title to set
	 */
	public void setTitle(String title) {
		this.title = title;
	}
	
	/**
	 * @return the owner
	 */
	public String getOwner() {
		return owner;
	}

	/**
	 * @param owner the owner to set
	 */
	public void setOwner(String owner) {
		this.owner = owner;
	}


	/**
	 * @return the date
	 */
	public String getDate() {
		return date;
	}

	/**
	 * @param date the date to set
	 */
	public void setDate(String date) {
		this.date = date;
	}

	/**
	 * @return the lastMediaId
	 */
	public String getLastMediaId() {
		return lastMediaId;
	}

	/**
	 * @param lastMediaId the lastMediaId to set
	 */
	public void setLastMediaId(String lastMediaId) {
		this.lastMediaId = lastMediaId;
	}

	public String getLastCommentId() {
		return lastCommentId;
		
	}

	public void setLastCommentId(String commentId) {
		lastCommentId = commentId;
		
	}
	
	@Override
	public boolean equals(Object obj) {
		if (obj == null || !(obj instanceof PostBean) )
			return false;
		PostBean anotherPostBean = (PostBean) obj;
		
		if (this.getId().equals(anotherPostBean.getId()))
			return true;
		
		return false;
	}

}
 
